package com.situ.login.dao;

import com.situ.login.entity.SysUser;
import com.situ.login.entity.quanxian;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface LoginUserDao {
//登录用户与身份都有效才可
@Select("select * from sys_user u inner join sys_role r on r.role_id=u.usr_role_id  where u.usr_Name=#{usr_Name} and u.usr_Password=#{usr_Password}")
    public SysUser LoginUser(@Param("usr_Name") String usr_Name,@Param("usr_Password") String usr_Password);


//根据登录身份的不同显示功能
@Select("select distinct * from sys_role r right join sys_role_might rm on r.role_id=rm.mf_role_id left join sys_might m on m.might_code=rm.mf_might_code" +
        " where   r.role_id=#{role_id}")
    public List<quanxian> queryParentList(@Param("role_id") Integer role_id);


}
